
%%
for k=1:10
    for nlhs = 50000
        %nlhs = 50000;
        filename = strcat('nn/data/lhs_',num2str(k),'_size',num2str(nlhs),'.csv');
        
        X_lhs = lhsdesign(nlhs,6,'Smooth','off').';
        
        % offset
        X_lhs(1,:) = 1.2*2*(X_lhs(1,:)-0.5);
        X_lhs(2,:) = 1.2*2*(X_lhs(2,:)-0.5);
        X_lhs(3,:) = 1.2*2*(X_lhs(3,:)-0.5);
        X_lhs(4,:) = 1.2*2*(X_lhs(4,:)-0.5);
        X_lhs(5,:) = 1.5*2*(X_lhs(5,:)-0.5);
        X_lhs(6,:) = 1.5*2*(X_lhs(6,:)-0.5);
        %X_lhs(7,:) = randsample(0:7, nlhs, true)/7;
        
        y_lhs = zeros(1,nlhs);
        n_lhs = zeros(7,1);
        for i=1:nlhs
            y_lhs(i) = fs_mpc(X_lhs(:,i).',0.2082*1.5,100*pi,Vdc/Ubase,Ts);
            n_lhs(y_lhs(i)) = n_lhs(y_lhs(i))+1;
        end
        XY_lhsgrid = [X_lhs;y_lhs].';
        writematrix(XY_lhsgrid,filename)
    end
end

%%
